-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return values for other modes. Functions for use in external tools. #8
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't realize you wanted to embed this via a C api! That's fine, just some initial comments about where the C/unsafe code should go.
I think it's up to shape now! |
Hi Brent, Okay, I finally had some time to get back into gopar stuff and to take a look at this, and I have some good news and bad news. Bad news first: the more I think about it, the more I'm convinced that exposing a single function Some reasons why I think this isn't the best fit:
So if we come up with a custom API, that'll solve all the above, I think. I took a look at https://github.com/brenthuisman/par2deep/tree/master/par2deep and didn't find anything referring to gopar -- I presume you're working on it in a local branch? If you could upload it / give me access to it, I can take a look at how you're using it, and then we can hammer out an interface. The good news is that I'm "paging in" all of the stuff I forgot about gopar, and I now have some time to work on it (although mostly on the weekend, with some nights). So my thinking about how this can go is:
|
True, but that does not make it less of a solution.
This is a view that matches those of the (various forks of) My reasons for having an API identical to the cmdline interface (i.e. passing in the same strings) has three benefits:
A better API would be
Tools that currently do (they're usually related to downloading software with a certain provenance, so it may be best not to link) include binaries and shell out.
You're right that the gopar fork for now only lives on my drive, but the difference is really only in the Create() flags that gopar (doesn't) support. This function is calling https://github.com/brenthuisman/par2deep/blob/master/par2deep/par2deep.py#L98
My plan was to take
Very little is the good news! Here an example of https://github.com/brenthuisman/par2deep/blob/master/par2deep/par2deep.py#L324
So, I guess I'll close it. The |
Ok, cool, so I think we're in agreement that the ideal solution would be a Go API that more closely mirrors the command-line interface (e.g. So now that I have some time, I'l try working on that, hopefully next weekend. I won't do the cgo part yet -- I figure we can tackle that as a follow-up. 👍 |
That's great! Don't hesitate to ping me to test / take care of the cgo part! |
par()
that ingests a[]string
which can be used exactly as the cmdline interface.-buildmode=c-shared